<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
{% if username %}
<p>用户名:{{username}}</p>
<a>注销</a>

{% else %}
<a>注册</a>
<a>登录</a>
{% endif %}

    <h1>首页</h1>
    <p>姓名：{{name}}</p>
    <p>年龄：{{age}}</p>
    <p>地址：{{address.city}}--{{address.shiqu}}</p>
    <p>请选择：{{blog[0]}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{blog[1]}}</p>
{% for book in books %}
<h2>小说：</h2><h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{book.作品}}</h3>
<h2>作者：</h2><h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{book.作者}}</h3>
<h2>主角：</h2><h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{book.主角}}</h3>
{% endfor %}

{% for item in range(7)%}
<h3 {% if loop.index%2 == 0%}style="background: red" {% else %} style="background: aqua"{% endif %}>重要的事情说三遍</h3>
{% endfor %}

</body>
</html>